import request from '@/utils/request'

export function getVideoLabel () {
  return request({
    method: 'GET',
    url: '/video/getvideolabel'
  })
}

// 获取视频评论
export function getVideoComment (videoid, currentCommentPage) {
  return request({
    method: 'GET',
    url: `/video/getvideocomment/${videoid}?page=${currentCommentPage}`
  })
}

// 获取回复评论
export function getReplyComment (commnentid, currentCommentPage) {
  return request({
    method: 'GET',
    url: `/video/getreplyComment/${commnentid}?page=${currentCommentPage}`
  })
}

// 下载视频
// export function download (url) {
//   z
//   return request({
//     method: 'GET',
//     url: `/video/download?url=${url}`
//   })
// }

export function handleDownLoad (url, name) {
  return request({
    url: `/video/download?url=${url}`,
    method: 'GET',
    headers: {
      Authorization: JSON.parse(window.localStorage.getItem('user')).token
    },
    responseType: 'blob'
  })
}
